
<?php 	include_once dirname(__FILE__).'/Authentication/CurrentClient.php'; ?>

<div class="header">
	<div class="left-side">
		<img src="./images/logo2.png" />
	</div>
	<div class="right-side">
		<div class=" right-side-right AdminMenu">
			<?php
				if (!isset($_SESSION))
					session_start();
		    	
		    	$isAuth = isset($_SESSION[USER_ID_KEY]);
				if ($isAuth) {
					$currentClient = unserialize($_SESSION[USER_ID_KEY]);
				}
				else {
					$currentClient = new CurrentClient();
					$currentClient->isActive = FALSE;
					
					$currentClient->id = '';
				    $currentClient->email = '';
				    $currentClient->name = '';
				    $currentClient->link = '';
				    $currentClient->picture = '';
				    $currentClient->locale = '';
				
				    $loginData = '';
				    $currentClient->isAdministrator = FALSE;
				    $currentClient->allRoles = '';	
				}
			
				$LoginPageUri = "{$RootDirectoryUri}/Authentication/GoogleLogin.php";
				if ($currentClient->isActive) {
					$currentClient = unserialize($_SESSION[USER_ID_KEY]);
					print "<p><strong>{$currentClient->email}</strong>";
					
//					print "<br />{$currentClient->allRoles}</p>";
					print "<br /></p>";
					 
					print "<a class='logout' href=".$LoginPageUri."?logout=1>Atsijungti</a>";
					print "</div>";
					print '<div class="TopMenu">';
						include('menu-top.html');
					print "</div>";	
				}
				else {
					print "<a class='login' href='$LoginPageUri'>Prisijungti</a>";			
					print "</div>";
				}
				print '<a id="floatBtn" href="edit.php?id='.$_SESSION['psl'].'" class="link link-white"><span class="editBtn">Taisyti</span></a>';
				
			?>
	</div>
	<div style="clear: both;"></div>
</div>